<?php

class Title{

	private $id_title;
	private $name;
	private $artist;
	private $youtube_id;
	
	public function __construct($map=array()){
		
		$this->id_title = isset($map['id_title']) ? $map['id_title'] : null ;
		$this->name = isset($map['name']) ? $map['name'] : "";
		$this->artist = isset($map['artist']) ? $map['artist'] : "";
		$this->youtube_id = isset($map['youtube_id']) ? $map['youtube_id'] : "";
		
	}
	
	public function update($data){
		
		if (isset($data['$name']))
			$this->setName($data['$name']);
		if (isset($data['artist']))
			$this->setArtist($data['artist']);
		if (isset($data['youtube_id']))
			$this->setYoutubeId($data['youtube_id']);
			
	}
	
	// Getter
	public function getIdTitle(){
		return $this->id_title;
	}
	
	public function getName(){
		return $this->name;
	}
	
	public function getArtist(){
		return $this->artist;
	}
	
	public function getYoutubeId(){
		return $this->youtube_id;
	}
	
	// Setter
	
	public function setName($name){
		$this->name=$name;
	}
	public function setArtist($artist){
		$this->artist=$artist;
	}
	public function setYoutubeId($id){
		$this->youtube_id=$id;
	}
	
}

?>